package chinatelecom.feilong.framework.web.license.service;

import chinatelecom.feilong.framework.web.license.entity.License;
import chinatelecom.feilong.framework.web.license.entity.LicenseMain;
import chinatelecom.feilong.framework.web.sys.entity.SysUser;
import com.ideal.license.core.model.LicenseModel;
import com.ideal.license.verifier.manager.VerifyModel;
import chinatelecom.feilong.framework.web.license.entity.LicenseTemplate;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

public interface ILicenseService {
     /**
      * 保存license信息
      * @param license
      * @return
      */
     License saveLicense(License license) throws Exception;

     /**
      * 续期license
      * @param license
      * @return
      * @throws Exception
      */
     License renewalLicense(License license)throws Exception;

     // 判断用户输入的版本号是否一致
     String findSameLicenseName(String subject)throws Exception;

     Page<LicenseMain> listPageByParams(Map<String, Object> params, Pageable pageable, String sortName, String sortValue);

     void deleteCascade(Integer id);

     License findByID(Integer id);
     // 查询用户选择的版本号
     LicenseTemplate findByVersion(Integer type);

     SysUser findUserId(String userName);

     List<License> listByMainId(Integer id);

     List<License> findAllBySubjectId(Integer subjectId);
}
